package domain;


import java.util.HashMap;
import java.util.Map;

public class Event {
	
	private Integer idEvent;
	private String loginUser;
	private String name;
	private String description;
	private Map<String,String> guests;
	private String eventDate;
	
	public Event(){
		idEvent=0;
		loginUser="";
		name="";
		description="";
		guests=new HashMap<String, String>();
		eventDate="";
	}

	/**
	 * @param idEvent
	 * @param idUsuario
	 * @param nombre
	 * @param descripcion
	 * @param invitados
	 */
	public Event(Integer _idEvent, String _loginUser, String _name, String _description, Map<String, String> _guest, String _eventDate) {
		this.idEvent = _idEvent;
		this.loginUser = _loginUser;
		this.name = _name;
		this.description = _description;
		this.guests = _guest;
		eventDate=_eventDate;
	}
	
	/**
	 * @param idUsuario
	 * @param nombre
	 * @param descripcion
	 * @param invitados
	 */
	public Event( String _loginUser, String _name, String _description, Map<String, String> _guest, String _eventDate) {
		this.loginUser = _loginUser;
		this.name = _name;
		this.description = _description;
		this.guests = _guest;
		eventDate=_eventDate;
	}

	/**
	 * @return the idEvento
	 */
	public Integer getIdEvent() {
		return idEvent;
	}

	/**
	 * @param idEvento the idEvento to set
	 */
	public void setIdEvento(Integer idEvent) {
		this.idEvent = idEvent;
	}

	/**
	 * @return the loginUser
	 */
	public String getLoginUser() {
		return loginUser;
	}

	/**
	 * @param loginUser the idUsuario to set
	 */
	public void setIdUser(String loginUser) {
		this.loginUser = loginUser;
	}

	/**
	 * @return the nombre
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param nombre the nombre to set
	 */
	public void setName(String nombre) {
		this.name = nombre;
	}

	/**
	 * @return the descripcion
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param descripcion the descripcion to set
	 */
	public void setDescription(String descripcion) {
		this.description = descripcion;
	}

	/**
	 * @return the invitados
	 */
	public Map<String, String> getGuests() {
		return guests;
	}

	/**
	 * @param invitados the invitados to set
	 */
	public void setGuests(Map<String, String> invitados) {
		this.guests = invitados;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result
				+ ((idEvent == null) ? 0 : idEvent.hashCode());
		result = prime * result
				+ ((loginUser == null) ? 0 : loginUser.hashCode());
		result = prime * result
				+ ((guests == null) ? 0 : guests.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Event other = (Event) obj;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (idEvent == null) {
			if (other.idEvent != null)
				return false;
		} else if (!idEvent.equals(other.idEvent))
			return false;
		if (loginUser == null) {
			if (other.loginUser != null)
				return false;
		} else if (!loginUser.equals(other.loginUser))
			return false;
		if (guests == null) {
			if (other.guests != null)
				return false;
		} else if (!guests.equals(other.guests))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return "Evento [idEvento=" + idEvent + ", idUsuario=" + loginUser
				+ ", nombre=" + name + ", descripcion=" + description
				+ ", invitados=" + guests + "]";
	}

	public void setEventDate(String eventDate) {
		this.eventDate = eventDate;
	}

	public String getEventDate() {
		return eventDate;
	}
	
	

}
